home *** CD-ROM | disk | FTP | other *** search
- OPT MODULE
- OPT EXPORT
- /*
- ** $VER: gtdrag.e 2.1 (17.12.96)
- ** Includes Release 2.7
- **
- ** Drag&Drop with GadTools
- **
- ** (C) Copyright 1996 Axel Dörfler
- ** All rights Reserved
- **
- ** Converted to E by Daniel Rost
- */
-
- MODULE 'exec/nodes','utility/hooks',
- 'intuition/intuition','libraries/gadtools',
- 'utility/tagitem','exec/tasks','exec/lists'
-
- /* The ImageNode structure is used to have both text and images in a listview.
- * A render hook for this type is provided. It is not a must!
- */
-
- OBJECT imagenode
- succ:PTR TO imagenode
- pred:PTR TO imagenode
- type:CHAR
- pri:CHAR
- name:PTR TO CHAR
- image:PTR TO image
- ENDOBJECT
-
- /* The DragGadget structure manages the gadgets which support dragging.
- * Remember that these fields are read-only!
- */
-
- CONST DGF_IMAGES=1, /* Images only, if possible */
- DGF_NODRAG=2, /* can't be the source of a drag */
- DGF_SAME=4, /* icon can be dragged over the same gadget */
- DGF_NOPOS=8 /* no positioning, listview only */
-
- OBJECT draggadget
- node:mln
- gadget:PTR TO gadget
- window:PTR TO window
- task:PTR TO tc /* pointer to the owner task */
- list:PTR TO lh
- render:PTR TO hook
- type:LONG
- mask:LONG
- acceptmask:LONG
- itemheight:INT
- width:INT
- height:INT
- flags:INT
- ENDOBJECT
-
- /* You receive the DragMsg structure if someone has dragged an item.
- * And again, all fields are read-only!
- */
-
- CONST DMT_GADGET=1, /* target is a window */
- DMT_WINDOW=2, /* target is a gadget */
- DMT_UNKNOWN=4 /* target doesn't support drag&drop */
-
- OBJECT dragmsg
- node:mln
- type:LONG
- object:PTR TO imagenode /* dragged object */
- source:PTR TO draggadget
- sourceapp:PTR TO CHAR /* owner Name or NULL for your own */
- target:LONG /* pointer to a DragGadget or Window */
- sourceentry:LONG /* the list position of the entry */
- targetentry:LONG /* dto. - may be higher than the number of entries */
- x:LONG /* exact co-ordinates */
- y:LONG
- ENDOBJECT
-
- /* The flags for the IDCMP-MsgPort of your Window */
-
- CONST DRAGIDCMP=LISTVIEWIDCMP OR IDCMP_MOUSEBUTTONS
-
- /* Tags to pass to GTD_AddGadget() */
-
- CONST GTDA_TAGBASE =TAG_USER + $90000
- CONST GTDA_ITEMHEIGHT =GTDA_TAGBASE + 1, /* height of a listview entry */
- GTDA_RENDERHOOK =GTDA_TAGBASE + 2, /* render hook for listview */
- GTDA_IMAGES =GTDA_TAGBASE + 3, /* drags only images (listview MUST contain ImageNodes) */
- GTDA_WIDTH =GTDA_TAGBASE + 4, /* width of icon (only for GTDA_RenderHook & GTDA_Images) */
- GTDA_HEIGHT =GTDA_TAGBASE + 5, /* height of a icon ("") */
- GTDA_NODRAG =GTDA_TAGBASE + 6, /* do not drag from this gadget */
- GTDA_OBJECT =GTDA_TAGBASE + 7, /* drag node from a non-listview */
- GTDA_SAME =GTDA_TAGBASE + 8, /* set DGF_SAME */
- GTDA_MASK =GTDA_TAGBASE + 9, /* mask value */
- GTDA_ACCEPTMASK =GTDA_TAGBASE + 10, /* accept mask value */
- GTDA_NOPOSITION =GTDA_TAGBASE + 11 /* set DGF_NOPOS */
-
- /* Tags to pass to GTD_AddApp() */
-
- CONST GTDA_INTERNALONLY=GTDA_TAGBASE + 42 /* drags only internally */
-
-